package com.gm.springboot.service.impl;

import com.github.pagehelper.PageHelper;
import com.gm.springboot.bean.Major;
import com.gm.springboot.mapper.MajorMapper;
import com.gm.springboot.service.MajorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Administrator
 * @Date 2020/7/2 17:24
 **/
@Service
public class MajorServiceImpl implements MajorService {
    @Autowired
    MajorMapper majorMapper;
    @Override
    public List<Major> findMajorAll(Integer page, Integer size) {
        PageHelper.startPage(page,size);
        return this.majorMapper.findMajorAll();
    }

    @Override
    public int delMajor(Integer mid) {
        return this.majorMapper.delMajor(mid);
    }

    @Override
    public int addMajor(Major major) {
        return this.majorMapper.addMajor(major);
    }

    @Override
    public Major findMajorById(Integer mid) {
        return this.majorMapper.findMajorById(mid);
    }

    @Override
    public int updMajor(Major major) {
        return this.majorMapper.updMajor(major);
    }
}
